package zhcms.cms;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import zhcms.db.DbConn;
import zhcms.framework.GySplit;

public class GySystem {
	
	public String SiteName;
	public String SiteUrl;
	public String SiteEMail;
	public String SystemVersion;
	
	public GySystem()
	{
		this.SetToP();
	}
	
	public ArrayList<HashMap<String, String>> getSysteminfo()
	{
		String sql="select InfoContent,Id,ishtml,SystemVersion from gyhy_System order by id desc limit 0,1 ";
		return DbConn.executeQuery(sql);
	}
	
	public void SetToP()
	{
		//GySystem gys=new GySystem();
		ArrayList<HashMap<String, String>> gytS;
		gytS=new ArrayList<HashMap<String, String>>();
		
		gytS=getSysteminfo();
		for(int i=0;i<gytS.size();i++)
		{
			Map<String,String> iS=new HashMap<String,String>();
			iS =gytS.get(i);
			
			String InfoContent=iS.get("InfoContent");
			
			String[] tempContent = null;
			GySplit a = new GySplit();
			a.tool(InfoContent, ",");
			tempContent = a.Show();
			a = null;
			
			setSiteName(tempContent[0]);
			setSiteUrl(tempContent[11]);
			setSiteEMail(tempContent[12]);
			setSystemVersion(iS.get("SystemVersion"));
			
		}
	}
	
	public String getSiteName() {
		return SiteName;
	}

	public void setSiteName(String siteName) {
		SiteName = siteName;
	}

	public String getSiteUrl() {
		return SiteUrl;
	}

	public void setSiteUrl(String siteUrl) {
		SiteUrl = siteUrl;
	}

	public String getSiteEMail() {
		return SiteEMail;
	}

	public void setSiteEMail(String siteEMail) {
		SiteEMail = siteEMail;
	}

	public String getSystemVersion() {
		return SystemVersion;
	}

	public void setSystemVersion(String systemVersion) {
		SystemVersion = systemVersion;
	}
	
}
